<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创建元素性能</title>
    <style>
        div {
            width: 100px;
            height: 2px;
            border: 1px solid #000;
        }
    </style>
</head>

<body>

</body>

</html>
<script>
    let startTime = new Date().getTime();
    for (let index = 0; index < 10000; index++) {
        let div = window.document.createElement('div');
        window.document.body.appendChild(div);
    }
    let endTime = new Date().getTime();
    window.console.log(endTime - startTime);
</script>